<?php
/**
 * IG_Task_Abstract
 *
 * @author maomao.thx@gmail.com
 * @copyright Copyright (c) 2009 Green Shore (http://www.iwgame.com)
 * @version $Id: Abstract.php 540 2011-05-26 07:25:07Z mmxie $
 */
abstract class IG_Task_Abstract
{
    /**
     * @var array
     */
    protected $_params = array();
    /**
     * 插件
     * @var array
     */
    protected $_plugins = array();

    public function __construct($params = null)
    {
        if ($params !== null) {
            $this->_params = $params;
        }
    }
    /**
     * 处理任务，并返回处理结果
     *
     * @param array $arg
     * @return boolean
     */
    public abstract function process();

    /**
     * 添加插件
     * @param $plugin
     */
    public function addPlugin($plugin)
    {
        $this->_plugins[] = $plugin;
    }

    /**
     * 返回所有的插件
     *
     * return array
     */
    public function getPlugins()
    {
        return $this->_plugins;
    }
}